<?php
// Display all pangrams 

/*
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// offset
$ox = 1*@$_REQUEST['ox']; 
if (empty($ox)) 
    $ox = 0;
$oy = 1*@$_REQUEST['oy'];
if (empty($oy)) 
    $oy = 0;
$size = 1*@$_REQUEST['size'];
if (empty($size))
    $size = 22;
if ($size < 0) $size = 0;
if ($size > 100) $size = 100;
// filter
$filter = @$_REQUEST['filter'];
if (empty($filter))
    $filter = "0";
echo "ox=$ox oy=$oy size=$size filter=$filter<br />";


$pangrams = explode("\n",file_get_contents('pangrams.txt'));
for ($i=0; $i<count($pangrams); $i++) {
	//if (preg_match($filter,$pangrams[$i])) {
	if (strpos($pangrams[$i],$filter)) {
	    //echo "$i .. <br />";
		$p = $pangrams[$i];
		echo '<img src="pangram.php?ox='.$ox.'&oy='.$oy.'&size='.$size.'&text='.htmlspecialchars(urlencode($p)).'" title="'.htmlspecialchars($p).'"/><br/>';
	}
}

?>

